package no.progark.pong;

import android.content.Context;

public class AIController extends Controller {

	public AIController(Context context) {
		super(context);
		
	}
	
	public void update(int ballPos, int speed){
		if(ballPos < getPosX() + (CONTROLLERWIDTH/2)){ //left of controller
			setPosX(getPosX()-speed);
		}
		else if(ballPos > getPosX()+(CONTROLLERWIDTH/2)){
			setPosX(getPosX()+speed);
		}
		//the ball will hit the controller, do nothing
	}



}
